package cn.zwk.controller;

import cn.zwk.common.model.R;
import cn.zwk.domain.system.model.vo.CaptchaVo;
import cn.zwk.domain.system.service.IAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/auth")
public class LoginController {

    @Autowired
    private IAuthService authService;

    @RequestMapping("/login")
    public String login(String username, String password) {
        return "login";
    }

    @RequestMapping("/logout")
    public String logout() {
        return "logout";
    }

    @GetMapping("/captcha")
    public R<CaptchaVo> getCaptcha() {
        CaptchaVo captcha = authService.getCaptcha();
        return R.ok(captcha);
    }
}
